/*
 * =====================================================================================
 *
 *       Filename:  map.h
 *
 *    Description:  定义地图类
 *
 *        Version:  1.0
 *        Created:  2008年11月05日 22时53分47秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Dr. Fritz Mehner (mn), mehner@fh-swf.de
 *        Company:  FH Südwestfalen, Iserlohn
 *
 * =====================================================================================
 */
#ifndef _CMYMAP
#define _CMYMAP

//公有的宏定义
//地图长 宽
#define _MAP_WIDTH 14
#define _MAP_HIGHT 22
//定义地图寻址宏
#define _MAP(cx,cy) (get_map() + cy* _MAP_WIDTH + cx)

//定义方块类型
#define _EMPTY 0x0
#define _FULL  0x1
#define _WALL  0xF

extern const unsigned Map[_MAP_HIGHT][_MAP_WIDTH];

class my_map{
	public:
		my_map();
		~my_map();

	public:
		virtual bool Init_map();
		virtual unsigned* get_map();
//		unsigned* get_map(unsigned _x, unsigned _y);
		virtual unsigned get_map(unsigned _x, unsigned _y);
		virtual unsigned set_map(unsigned _x, unsigned _y);
		virtual unsigned clear_map(unsigned _x, unsigned _y);
//		virtual void check_map(); //地图上是否有可以削减的行 有就削减

	private:
		unsigned *m_pMap;
};

#endif
